<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../common/include_list_head.jsp" %>
    <script type="text/javascript" src="${basePath }/component/datepicker/WdatePicker.js"></script>
    <script type="text/javascript">
        /**
        *设置资源
         */
        function szzy(gzwid){
            var url = "${basePath}" + "/business/regulation-szzy.action?gzwid=" + gzwid;
            top.Dialog.open({URL:url,Title:"设置资源",Width:600,Height:420});
        }

        /**
         * 在列表页面打开输入页面的函数
         * @param {Object} id :wid 主键值
         * @param {Object} readOnlyPage :boolean value 是否只读页面。默认false
         * @param {Object} urlParameterStr 附加参数对
         * @param {Object} actionMethod action的方法名称
         */
        function openEntity(id, readOnlyPage, urlParameterStr, actionMethod, myActionName) {
            var uri;
            var _actionMethod = "input";
            if (actionMethod && actionMethod.length > 0) {
                _actionMethod = actionMethod;
            }
            if (myActionName && myActionName.length > 0) {
                actionName = myActionName;
            }
            uri = actionName + "-" + _actionMethod + "." + uri_suffix + "?reqtime="
                    + new Date().getTime();

            if (id && id.length > 0) {
                uri += "&wid=" + id;
            }
            if (urlParameterStr && urlParameterStr.length > 0) {
                uri += "&" + urlParameterStr;
            }

            var windowWidth = document.body.clientWidth - 200;
            var windowHeight = document.body.clientHeight - 60;
            if(windowWidth<650){
                windowWidth += 160;
            }
            if(windowHeight<420){
                windowHeight = 420;
            }


            if (readOnlyPage || readOnlyPage == "true") {
                uri += "&readOnlyPage=" + readOnlyPage;
                openWindow(uri, windowWidth, windowHeight);
            } else if (dialogType_debug) {

                openDebugWindow(uri);
            } else {
                openWindow(uri, windowWidth, windowHeight);
            }
        }


        /**
         * 编辑选中的纪录
         */
        function doModify() {
            var id = floatchickButton(1);
            if(id != false){
                openEntity(id, false);
            }
        }
    </script>
</head>
<body>
<div id="scrollContent">

    <s:if test="actionErrors.size()>0 || actionMessages.size()>0 || fieldErrors.size()>0">
        <div id="SystemErrorMessage">
            <s:actionerror/>
            <s:actionmessage/>
            <s:fielderror/>
        </div>
    </s:if>

    <s:form theme="simple" name="ysform">
        <s:hidden name="pager.formname" value="ysform"/>
        <s:hidden name="pager.currentPageno" id="yspager_currentPageno"/>
    </s:form>

    <div id="userRoleMenuButton">
        <button onclick="openEntity()"><span class="icon_add">新增</span></button>
        <button onclick="doModify()"><span class="icon_edit">修改</span></button>
        <button onclick="doRemove()"><span class="icon_delete">删除</span></button>
    </div>
    <div>
        <table class="tableStyle" style="width:100%;">
            <tr>
                <th width="3%"></th>
                <th nowrap="nowrap" width="20%">业务规则</th>
                <th nowrap="nowrap" width="20%">业务规则梳理</th>
                <th nowrap="nowrap" width="5%">资源数</th>
                <th nowrap="nowrap" width="10%">创建人</th>
                <th nowrap="nowrap" width="10%">创建时间</th>
                <th nowrap="nowrap" width="10%">操作</th>
                <th nowrap="nowrap" width="10%">附件下载</th>

            </tr>
            <s:iterator value="resultData">
                <tr>
                    <td align="center"><s:checkbox id="%{wid}" name="selectNode" fieldValue="%{wid}"/></td>
                    <td nowrap="nowrap">
                        <span class="text_slice" style="width:200px;" title='<s:property value="bt"/>'><a class="bluea" target="_blank" href="${basePath}/s/rulesdetail/<s:property value="wid"/>"><s:property value="bt"/></a></span>
                    </td>
                    <td nowrap="nowrap"><span class="text_slice" style="width:200px;" title='<s:property value="nrzy"/>'><s:property value="nrzy"/></span></td>
                    <td nowrap="nowrap"><a class="bluea" title="设置关联的资源" href="javascript:szzy('<s:property value="wid"/>')"><s:property value="zys"/></a></td>
                    <td nowrap="nowrap"><s:property value="cjr"/></td>
                    <td nowrap="nowrap"><s:date format="yyyy-MM-dd HH:mm" name="jlcssj" /></td>

                    <td nowrap="nowrap">
                        <a class="bluea" href="javascript:openEntity('<s:property value="wid"/>')">编辑</a>
                        <a class="bluea" title="设置关联的资源" href="javascript:szzy('<s:property value="wid"/>')">资源</a>

                    </td>

                    <td>
                        <div class="simpleMenu" style="width:80px;">
                            <div class="simpleMenu_link arrow border white_bg">
                                <a href="javascript:;">附件下载</a>                            </div>
                            <div class="simpleMenu_con" style="width:80px;">
                                <s:if test="fjdz !=null">
                                    <a target="_blank" class="bluea" title="<s:property value="fjmc"/>" href='${basePath}/<s:property value="fjdz"/>'>需求规则下载</a>
                                </s:if>
                                <s:if test="dyzdscfjdz !=null">
                                    <a target="_blank" class="bluea" title="<s:property value="dyzdscfjmc"/>" href='${basePath}/<s:property value="dyzdscfjdz"/>'>对应制度下载</a>
                                </s:if>
                                <s:if test="ysxqfjurl !=null">
                                    <a target="_blank" class="bluea" title="<s:property value="ysxqfjsm"/>" href='${basePath}/<s:property value="ysxqfjurl"/>'>原始需求附件</a>
                                </s:if>
                                <s:if test="gzzdfjurl !=null">
                                    <a target="_blank" class="bluea" title="<s:property value="gzzdfjsm"/>" href='${basePath}/<s:property value="gzzdfjurl"/>'>规章制度附件</a>
                                </s:if>
                            </div>
                        </div>
                    </td>
                </tr>
            </s:iterator>
        </table>
    </div>
    <div style="height: 45px;">
        <div id="pagelist" style="display: none">
            <s:property value="pager.postToolBar" escape="false"/>
        </div>

        <div class="clear"></div>
    </div>
</div>
</body>
</html>
